package com.yunhe.tianhe.rentcars.service.cheliangguanli.impl;


import com.yunhe.tianhe.commons.dto.Pageable;
import com.yunhe.tianhe.rentcars.dao.cheliangguanli.ZuYongDao;
import com.yunhe.tianhe.rentcars.entity.cheliangguanli.ZuYong;
import com.yunhe.tianhe.rentcars.service.cheliangguanli.ZuYongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

@Service
public class ZuYongServiceImpl implements ZuYongService {

    private Pageable<ZuYong> pageable=new Pageable<>();
    @Autowired
    private ZuYongDao zuYongDao;
    @Override
   @ResponseBody
    public Pageable findPage(Integer offset, Integer limit, String carcode, Date usecartime, Date returntime) {
        List<ZuYong> list = zuYongDao.findPage1(offset,limit,carcode,usecartime,returntime);
        int i = zuYongDao.findPage2();
        pageable.setRows(list);
        pageable.setTotal(Long.valueOf(i));
        return pageable;
    }


}
